package com.cy2;

import jdk.swing.interop.SwingInterOpUtils;

import java.io.*;

public class CopyTxtDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("myByteStream\\fos.txt");
        FileOutputStream fos = new FileOutputStream("D:\\fos.txt");
        int by;
        while((by=fis.read())!=-1){
            fos.write(by);
        }
        fis.close();
        fos.close();
        File file = new File("D:\\fos.txt");
        file.delete();
    }
}
